package com.itheima.jdk8date;

import java.time.LocalDateTime;

/**
 * JDK8 时间类添加或者减去时间的方法
 */
public class JDK8DateDemo6 {
    public static void main(String[] args) {
        //public LocalDateTime plusYears (long years)   添加或者减去年
        LocalDateTime of = LocalDateTime.of(2020, 12, 31, 12, 13, 14);
        LocalDateTime localDateTime = of.plusMonths(-50);
        System.out.println(localDateTime);
        System.out.println(of.plusYears(-5000));

    }
}
